Inside Macintosh: Macintosh Toolbox Essentials

Previous | Chapter Top | Chapter Contents | Next

Manipulating Window Color Information

This section describes the functions you use for setting and retrieving window color information. Your application does not normally change window color information.

SetWinColor

Sets a window's window color table.

pascal void SetWinColor (WindowPtr theWindow,
                     WCTabHandle newColorTable);
theWindow
A pointer to the window's window record.
newColorTable
A handle to a window color table record, which defines the colors for the window's new color table.

DESCRIPTION

The SetWinColor function sets a window's color table. If the window has no auxiliary window record, it creates a new one with the specified window color table and adds it to the auxiliary window list. If the window already has an auxiliary record, its window color table is replaced. The Window Manager then redraws the window frame and highlighted text in the new colors and sets the window's background color to the new content color.

If the new color table has the same entries as the default color table, SetWinColor changes the auxiliary window record so that it points to the default color table.

Window color table resources (resources of type 'wctb' ) should not be purgeable.

If you specify a value of nil for the parameter theWindow , SetWinColor changes the default color table in memory. Your application shouldn't, however, change the default color table.

SEE ALSO

For a description of a window color table, see "The Window Color Table Record" . For a description of the auxiliary window record, see "The Auxiliary Window Record" . For a description of the 'wctb' resource, see "The Window Color Table Resource" .

GetAuxWin

Gets a handle to a window's auxiliary window record.

pascal Boolean GetAuxWin (WindowPtr theWindow,
                     AuxWinHandle *awHndl);
theWindow
A pointer to the window's window record.
awHndl
A pointer to an address at which GetAuxWin places a handle to the window's auxiliary window record.

DESCRIPTION

The GetAuxWin function returns a Boolean value that reports whether or not the window has an auxiliary window record, and it sets the value referenced through the parameter awHndl to contain a handle to the window's auxiliary window record.

If the window has no auxiliary window record, GetAuxWin places the default window color table in the value referenced through awHndl and returns a value of false .

SEE ALSO

For a description of the auxiliary window record, see "The Auxiliary Window Record" .


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next